// 对外暴露配置路由(常量路由)
export const constantRoute = [
    {
        name: "Login",
        path: "/login",
        component: () => import("@/views/login/index.vue"),
        meta: {
            title: "登录",
            hidden: true,
            icon: "Promotion",
        },
    },
    {
        name: "Register",
        path: "/register",
        component: () => import("@/views/register/index.vue"),
        meta: {
            title: "注册",
            hidden: true,
            icon: "Promotion",
        },
    },
    {
        name: "Layout",
        path: "/",
        component: () => import("@/layout/index.vue"),
        redirect: "/home",
        children: [
            {
                path: "/home",
                component: () => import("@/views/home/index.vue"),
                meta: {
                    title: "首页",
                    hidden: false,
                    icon: "HomeFilled",
                },
            },
        ],
        meta: {
            hidden: false,
            icon: "",
        },
    },
    {
        name: "Search",
        path: "/search",
        component: () => import("@/layout/index.vue"),
        redirect: "/search/subject",
        children: [
            {
                path: "/search/subject",
                component: () => import("@/views/search/subject/index.vue"),
                meta: {
                    title: "课题搜索",
                    hidden: false,
                    icon: "Document",
                },
            },
            {
                path: "/search/user",
                component: () => import("@/views/search/user/index.vue"),
                meta: {
                    title: "用户搜索",
                    hidden: false,
                    icon: "User",
                },
            },
        ],
        meta: {
            hidden: false,
            icon: "Search",
            title: "搜索",
        },
    },
    {
        name: "SubjectDetail",
        path: "/subjectDetail",
        component: () => import("@/layout/index.vue"),
        redirect: "/subjectDetail/info",
        meta: {
            hidden: true,
            icon: "More",
        },
        children: [
            {
                name: "Subjecthome",
                path: "/subjectDetail/info/:subjectId",
                component: () => import("@/views/subject/detail/index.vue"),
                meta: {
                    title: "课题详情",
                    hidden: true,
                    icon: "More",
                },
            },
        ],
    },
];

// 异步路由
export const asyncRoute = [
    {
        name: "Subject",
        path: "/subject",
        component: () => import("@/layout/index.vue"),
        redirect: "/subject/my",
        children: [
            {
                name: "mySubject",
                path: "/subject/my",
                component: () => import("@/views/subject/my/index.vue"),
                meta: {
                    title: "我的课题",
                    hidden: false,
                    icon: "Folder",
                },
            },
            {
                name: "createSubject",
                path: "/subject/create",
                component: () => import("@/views/subject/create/index.vue"),
                meta: {
                    title: "申报课题",
                    hidden: false,
                    icon: "Plus",
                },
            },
        ],
        meta: {
            title: "课题管理",
            hidden: false,
            icon: "Notebook",
        },
    },
    {
        name: "Settings",
        path: "/settings",
        component: () => import("@/layout/index.vue"),
        meta: {
            title: "设置",
            hidden: false,
            icon: "Setting",
        },
        redirect: "/settings/user",
        children: [
            {
                name: "User",
                path: "/settings/user",
                component: () => import("@/views/settings/user/index.vue"),
                meta: {
                    title: "修改个人信息",
                    hidden: false,
                    icon: "User",
                },
            },
            {
                name: "Safe",
                path: "/settings/safe",
                component: () => import("@/views/settings/safe/index.vue"),
                meta: {
                    title: "修改密码",
                    hidden: false,
                    icon: "Lock",
                },
            },
            {
                name: "EditEmail",
                path: "/settings/editEmail",
                component: () => import("@/views/settings/editEmail/index.vue"),
                meta: {
                    title: "修改邮箱",
                    hidden: false,
                    icon: "Message",
                },
            },
        ],
    },
];

// 任意路由
export const anyRoute = [
    {
        path: "/:pathMatch(.*)*",
        redirect: "/404",
        name: "Any",
        meta: {
            title: "其它路由",
            hidden: true,
        },
    },
    {
        name: "404",
        path: "/404",
        component: () => import("@/views/404/index.vue"),
        meta: {
            title: "404",
            hidden: true,
            icon: "DocumentDelete",
        },
    },
];
